$(".am-form").submit(function () {
    var formData = $('.am-form').serialize();
    $.ajax({
        url:'../doplogin',
        data:formData,
        type:'post',
        dataType:'json',
        success:function (data) {
            if (data['status']){
                layer.msg("登录成功！",{offset:'50%',icon:6,time:1000},function () {
                    location.href = 'phone';
                });
            } else {
                layer.msg("手机号或密码错误！",{offset:"50%",icon:6,time:1000},function () {
                    location.reload();
                });
            }
        }
    })
    return false;
});